package com.kmxd.ams.app.event;

import com.kmxd.ams.client.event.AmsEvent;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

/**
 * 统一事件发布接口
 *
 * @author nickbi
 */
@Slf4j
@Component
@AllArgsConstructor
public class AmsEventPublisher {

  private ApplicationEventPublisher applicationEventPublisher;

  public void publishEvent(AmsEvent event) {
    log.debug("start publish ams event: {}", event.toString());
    applicationEventPublisher.publishEvent(event);
    log.debug("end publish ams event");
  }
}
